<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.pic{
				width: 200px;
				height: 100px;
				background: red;
				border: 1px solid black;
				margin-top: 20px;
			}
		</style>
	</head>
	<body>
		<input id="t" type="text"/>
		<button onclick="oDiv.style.background = t.value">变色</button>
		<div id="oDiv" class="pic"></div>
	</body>
</html>